From: Alexandre Emsenhuber Date: Mon, 3 Oct 2011 14:04:43 +0000 (+0000) Subject: Also catch Special:Badtitle to display the "Bad title" error message since this is... X-Git-Tag: 1.31.0-rc.0~27290 X-Git-Url: http://git.cyclocoop.org/%7D%7Cconcat%7B?a=commitdiff_plain;h=e3dad1f942137234b003839655b76258acb61977;p=lhc%2Fweb%2Fwiklou.git Also catch Special:Badtitle to display the "Bad title" error message since this is now how it is passed in the context object. When such error occured, the user was redirected to Special:Badtitle and got the "Special page does not exist" message. --- diff --git a/includes/Wiki.php b/includes/Wiki.php index 649fb13748..0755a09b3b 100644 --- a/includes/Wiki.php +++ b/includes/Wiki.php @@ -147,8 +147,10 @@ class MediaWiki { array( &$title, null, &$output, &$user, $request, $this ) ); // Invalid titles. Bug 21776: The interwikis must redirect even if the page name is empty. - if ( is_null( $title ) || ( ( $title->getDBkey() == '' ) && ( $title->getInterwiki() == '' ) ) ) { - $this->context->title = SpecialPage::getTitleFor( 'Badtitle' ); + if ( is_null( $title ) || ( $title->getDBkey() == '' && $title->getInterwiki() == '' ) || + $title->isSpecial( 'Badtitle' ) ) + { + $this->context->setTitle( SpecialPage::getTitleFor( 'Badtitle' ) ); throw new ErrorPageError( 'badtitle', 'badtitletext' ); // If the user is not logged in, the Namespace:title of the article must be in // the Read array in order for the user to see it. (We have to check here to